<?php
/**
 * Created by PhpStorm.
 * User: LAI
 * Date: 23.7.14
 * Time: 14.52
 */
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
  <title>Register - IShop</title>
  <meta http-equiv="Content-Type" content="text/html;  charset=utf-8">
  <link href="css/register.css" rel="stylesheet"/>
  <link href="css/page_plus_menu.css" rel="stylesheet"/>
</head>

<?php
include_once("nonlogined_menu.php");
?>

<body style="background-color: rgba(1,1,1,0.8); margin: 0">

<div class="bodyDivToMenu">
</div>

<div class="registerFormDiv">
  <div class="registerForm">
    <form action="handlers/register_handler.php" method="post">

      <label>
        Name: <input type="text" name="username" value="<?= $_POST['username'] ?>"/>
      </label><br/>

      <label>
        Password: <input type="password" name="password" value="<?= $_POST['password'] ?>"/><br/>
      </label>

      <div class=" passwordRepeat">
        <div class="formAndErrorPasswordDiv">
          <label>
            Repeat password: <input type="password" name="passwordrepeat" value="<?= $_POST['passwordrepeat'] ?>"/><br/>
          </label>
        </div>
        <div class="formAndErrorPasswordDiv">
          <?php
          if (strcmp($_POST['password'], $_POST['passwordrepeat'])) {
            echo "Invalid password";
          }
          ?>
        </div>
        <div>

          <label>
            Addres: <input type="text" name="addres" value="<?= $_POST['addres'] ?>"/><br/>
          </label>

          <label>
            Email: <input type="text" name="email" value="<?= $_POST['email'] ?>"/><br/>
          </label>
          <br/>

          <input type="submit" name="submit" value="Submit"/>
    </form>
  </div>
</div>
</body>